<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{$site_title}-吃货凑份子钱测一测有没毒、快来支持我</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" type="text/css" href="http://apps.bdimg.com/libs/blendui/2.0.0/boost.min.css" />
<link rel="stylesheet" type="text/css" href="{$resource_basic}/css/webapp.css" />
<script type="text/javascript" src="{$resource_basic}/js/jquery.min.js"></script>
<script type="text/javascript" src="http://apps.bdimg.com/libs/blendui/2.0.0/boost.min.js"></script>
<script type="text/javascript">window.boost = $.noConflict(true);</script>
<style>
.blend-panel { background-color: #fff; }
/*.blend-suggest-wrap,.blend-suggest-wrap2{background-color: #03ab9e;}*/
.blend-suggest-input-blue .blend-suggest-ico { background-color: #03ab9e; }
.blend-suggest-arrow:before { color: #fff; }
.main-content { background-color: #fff; }
.blend-suggest-input-gray { height: 40px; }
.blend-suggest-input-gray input { height: 30px; font-size: 1.8rem; }
.main-content img { width: 100%; }
.blend-button-large { background-color: #03ab9e; }
.blend-card-img-view { width: 45px; height: 45px; }
/*新增样式*/
.clear { height: 0; font-size: 0; line-height: 0; overflow: hidden; clear: both; }
.clearfix:before, .clearfix:after { display: table; line-height: 0; content: ""; }
.clearfix:after { clear: both; }
.clearfix { *zoom: 1;}
.text-wrap { word-break: break-all !important; word-wrap: break-word !important; -webkit-box-orient: inherit!important; text-overflow: inherit!important; -webkit-line-clamp: inherit!important; overflow: visible!important; display: block!important; }
#list_more .blend-card:last-child { border-bottom: none!important; }
#list_more .blend-card-img-view img { -moz-border-radius: 50%!important; -webkit-border-radius: 50%!important; border-radius: 50%!important; }
#list_more .blend-card-content-view { max-height: inherit!important; }
.well { min-height: 20px; padding: 10px; margin-top: 15px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); font-size: 14px; padding: 10px 15px; line-height: 25px; }
</style>
</head>

<body>
    
    <header data-blend-widget="header" class="blend-header header_title_bg">
        <span class="blend-header-left">
            <a class="blend-header-item  blend-button" href="javascript:history.go(-1);"><img src="{$resource_basic}/img/btn_back.png" style="height:28px;"/></a>
        </span>
        <span class="blend-header-title">
            <a class="blend-header-item">食品安全热点</a>
        </span>
        <span class="blend-header-right">
            <if condition="$get_new.ifcollection eq 0">
                <img id="collection_mark" ifcollection="{$get_new.ifcollection}" onclick="javascript:collection_action({$get_new.ifcollection});" src="{$resource_basic}/img/collection_no.png" />
                <else/>
                <img id="collection_mark" ifcollection="{$get_new.ifcollection}" onclick="javascript:collection_action({$get_new.ifcollection});" src="{$resource_basic}/img/collection_yes.png" />
            </if>
        </span>
    </header>
    
    <div class="main-content">
        <div class="blend-panel" style=" padding:5%;">
            <div class="blend-panel-left">
                <span><b style="font-size:1.6rem;">{$get_new.title}</b></span><br />
                <span style="font-size:1.3rem;">{$get_new.author} {$get_new.stime|date="Y-m-d",###}</span>
                <div class="blend-separator"></div>
            </div>
            <div class="blend-panel-left" style=" font-size: 1.6rem;">
                {$get_new.content}
            </div>
            <div>
              
            </div>
        </div>
    </div>
    
    <div class="blend-panel">
        <div class="blend-panel-header blend-panel-left">
            精彩评论 <span style="float:right; color: #03ab9e;" id='add_commnet'> + 我来说两句</span>
        </div>
        <div class="blend-panel-body" style=''>
           <notempty name="get_new.hot_comments">
                <div id='list_more'>
                <volist name="get_new.hot_comments" id="vo">                    
                    <div class="blend-card blend-card-no-icon clearfix" style="position: relative;">              
						<div class="blend-card-img-view" style="float: left;"> <img src="{$vo.avatar}" style="border-radius:100%;"></div>
						<div class="blend-card-content-view" style="width:75%;float: right; min-height: 70px; max-height:inherit;">
							<div class="blend-card-title clearfix"> <span>{$vo.username}</span>
								<div style=" float:right; margin-left:5%;"> <a href="{:U('M/News/comment_detail',array('fdid'=>$vo['for_id'],'pid'=>$vo['id']))}"><img src="__PUBLIC__/template/default/img/comments_child.png" style="width:1.6rem; height:1.6rem; ">&nbsp; <span class="small_tips">{$vo.comment_count}</span> </a> </div>
                                <div  style=" float:right;"><img class='likeit' cid='{$vo.id}' src="__PUBLIC__/template/default/img/comment_likes.png" style="width:1.6rem; height:1.6rem; ">&nbsp; <span class="small_tips likecount">{$vo.likecount}</span> </div>
								<div style="clear:both"></div>
							</div>
							<div class="blend-card-sub-title"><span>{$vo.ctime|date="Y-m-d H:i",###}</span></div>
							<a href="{:U('M/News/comment_detail',array('fdid'=>$vo['for_id'],'pid'=>$vo['id']))}">
								<div class="blend-card-text comment-content text-wrap" style="margin-top:10px;margin-bottom:10px;height:auto"><span style="font-size:14px;">{$vo.content}</span></div>
							</a>
							<if condition="$vo.child_comment_count gt 0">
                              <div class="well">
                                <ul style="margin: 0;padding: 0;list-style: none">
                                  <volist name="vo.child_comments" id="voo">
                                    <li><span style="color: #03ab9e;">{$voo.username}：</span>{$voo.content}</li>
                                  </volist>
                                    
                                </ul>
                                <a  href="{:U('M/News/comment_detail',array('fdid'=>$vo['for_id'],'pid'=>$vo['id']))}" style="color: #03ab9e;">查看更多评论</a>
                            </div>
                            </if>
						</div>
						<div style="clear:both"></div>
					</div> 
    

                </volist>
                </div>

            <else/>
                暂无评论,我来说两句.
            </notempty> 
            
            
        </div>
        <div class="blend-panel-footer blend-panel-center" style="font-size:1.5rem; color: #03ab9e;">
            <a href="{:U('comments',array('fdid'=>$get_new['id'],'pid'=>0))}" style="font-size:1.5rem; color: #03ab9e;"> 查看更多评论({$get_new.comment_count}) &gt; </a>
        </div>
    </div>
    
    <div id="customDialog" class="blend-dialog">
        <div class="blend-grid blend-container-fluid" style="margin-top:20px;">
            <div class="blend-formgroup">
                <textarea class="blend-formgroup-input" style=" height: 60px;" id="content" name="content" placeholder="我想说两句..."></textarea>
            </div>
            <div class="" style=" margin-top:10px; margin-bottom:10px;">
                <button class="blend-button blend-button-primary blend-button-large" id="success" style=" background-color:#03ab9e;">发布</button>
            </div>  
        </div>
    </div>
    <!--<a class="blend-button blend-button-primary blend-button-large" href="{:U('M/News/comments',array('fdid'=>$get_new['id'],'pid'=>0))}">评论入口</a>-->
<!--底部菜单end-->
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
//分享

wx.config({
    debug: false,
    appId: '{$signPackage["appId"]}',
    timestamp: {$signPackage["timestamp"]},
    nonceStr: '{$signPackage["nonceStr"]}',
    signature: '{$signPackage["signature"]}',
    jsApiList: [
      // 所有要调用的 API 都要加到这个列表中
      'onMenuShareTimeline',
      'onMenuShareAppMessage'
    ]
});


wx.ready(function () {
// 在这里调用 API
    wx.onMenuShareTimeline({
        title: '{$get_new.title}', // 分享标题
        desc: '食品安全靠大家，一步一步更安全，我觉得这个信息很实用……', // 分享描述
        link: "{$site_url}{:U('M/News/details_for_share')}"+"?id="+{$get_new.id}, // 分享链接
        imgUrl: 'http://www.zhongcetianxia.com/logo.png', // 分享图标
        success: function () { 
            // 用户确认分享后执行的回调函数，生成红包

        },
        cancel: function () { 
            // 用户取消分享后执行的回调函数
        }
    });
    
    wx.onMenuShareAppMessage({
        title: '{$get_new.title}', // 分享标题
        desc: '食品安全靠大家，一步一步更安全，我觉得这个信息很实用……', // 分享描述
        link: "{$site_url}{:U('M/News/details_for_share')}"+"?id="+{$get_new.id}, // 分享链接
        imgUrl: 'http://www.zhongcetianxia.com/logo.png', // 分享图标
        type: '', // 分享类型,music、video或link，不填默认为link
        dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
        success: function () { 
            // 用户确认分享后执行的回调函数

        },
        cancel: function () { 
            // 用户取消分享后执行的回调函数
        }
    });

});

</script>

<script>
    $(function(){
         $("#add_commnet").bind('click',function(){
            boost(".blend-dialog").dialog("show");
        });
        
        $("#success").click(function(){
        
        var content = $("#content").val();
        
        //评论不能为空
        if(content.length===0)
        {
            alert("评论不能为空");
            return false;
        }
        var pid=0;
        var mid = {$mid};
        var fdid= {$id} ;
        
        $.ajax({ 
                   type: 'POST', 
                   url: '{:U("M/News/comments_add")}', 
                   dataType: 'json', 
                   data:"pid="+pid+"&mid="+mid+"&fdid="+fdid+"&content="+content,
                   cache: false, 
                   error: function(){ 
                       return false; 
                   }, 
                   success:function(json){ 
                        if(json===1)
                        {
                            window.location.reload();
                        }else if(json===2)
                        {
                            alert('存在敏感词!');
                            
                        }else{
                            alert("添加失败，请稍后再试");
                        }
                        
                        boost(".blend-dialog").dialog("hide");
                        
                   } 
               });

    });
    
    $(".likeit").one('click',function(){
        
        var mid = {$mid};
        var cid= $(this).attr("cid") ;
        
        var likecount = parseInt($(this).parent().find(".likecount").text());
        
        $(this).attr("src","/Public/template/default/img/evaluation_zan_sel.png");
        
        likecount++;
        $(this).parent().find(".likecount").text(likecount);
        
        
        
        $.ajax({ 
                   type: 'GET', 
                   url: '{:U("M/News/comments_like_add")}', 
                   dataType: 'json', 
                   data:"cid="+cid+"&mid="+mid,
                   cache: false, 
                   error: function(){ 
                       return false; 
                   }, 
                   success:function(json){ 
                        if(json===1)
                        {
                            //本地刷新
                            
                        }
                        else
                        {
                            alert("添加失败，请稍后再试");
                            
                        }
                        
                        
                   } 
               });

    });
    });
    
     boost("#customDialog").dialog({
        maskTapClose:true,
        renderType:2
    });
    
    function collection_action(status)
    {
//        获取收藏状态
        var ifcollection = $("#collection_mark").attr("ifcollection");
        $.ajax({ 
                type: 'GET', 
                url: '{:U("M/News/add_one_colletion")}', 
                dataType: 'json', 
                data:"mid="+{$mid}+"&ifcollection="+ifcollection+"&id="+{$id},
                cache: false, 
                error: function(){ 
                    return false; 
                }, 
                success:function(json){ 
                     if(json===1)
                     {
                         //修改成功
                         if(ifcollection===1||ifcollection=="1")
                         {
                             $("#collection_mark").attr("src","{$resource_basic}/img/collection_no.png");
                             var $toast = $.blend.toast();
                             $toast.show("取消收藏",1000);
                              $("#collection_mark").attr("ifcollection","0");
                         }
                         else
                         {
                             $("#collection_mark").attr("src","{$resource_basic}/img/collection_yes.png");
                             var $toast = $.blend.toast();
                             $toast.show("收藏成功",1000);
                             $("#collection_mark").attr("ifcollection","1");
                         }
                         
                         
                     }
                     else
                     {
//                         $("#collection_mark").attr("src","{$resource_basic}/img/collection_no.png");
                     }

                } 
            });
    }
</script>
<?php require_once 'cs.php';echo '<img src="'._cnzzTrackPageView(1256622573).'" width="0" height="0"/>';?>
<include file="Index/foot_analyze"/>
</body>
</html>